*****************************************
*** ONLINE APPENDIX: SOCIAL DIVISIONS ***
***************************************** 

*NOTE: This do-file should be executed on the dataset: "aggregate-level-data"
*NOTE: To reproduce the main results, please use Stata 15 with the following packages installed:
ssc install estout
*NOTE: If package is already installed, run the do-file from here
tsset year

** Table A7 ***
*Cross-lagged models at the aggregate level (class gap in vote choice)
estimates clear
*predicting class partisanship
eststo: reg c.classvoting c.lagclassvoting c.ilworkerpos if election==1, cluster(year)
eststo: reg c.classvoting c.lagclassvoting c.ilbusinesspos if election==1, cluster(year)
eststo: reg c.classvoting c.lagclassvoting c.ilpoorpos if election==1, cluster(year)
*predicting class emphasis
eststo: reg c.ilworkerpos c.lagilworkerpos c.lagclassvoting if election==1, cluster(year)
eststo: reg c.ilpoorpos c.lagilpoorpos c.lagclassvoting if election==1, cluster(year)
eststo: reg c.ilbusinesspos c.lagilbusinesspos c.lagclassvoting if election==1, cluster(year)
esttab

*** Table A8 ***
*Cross-lagged models at the aggregate level (class gap in partisanship) 
estimates clear
*predicting class voting
eststo: reg c.classpartisanship c.lagclasspartisanship c.ilworkerpos, cluster(year)
eststo: reg c.classpartisanship c.lagclasspartisanship c.ilbusinesspos, cluster(year)
eststo: reg c.classpartisanship c.lagclasspartisanship c.ilpoorpos, cluster(year)
*predicting class emphasis
eststo: reg c.ilworkerpos c.lagilworkerpos c.lagclasspartisanship, cluster(year)
eststo: reg c.ilbusinesspos c.lagilbusinesspos c.lagclasspartisanship, cluster(year)
eststo: reg c.ilpoorpos c.lagilpoorpos c.lagclasspartisanship, cluster(year)
esttab

*END OF DO-FILE
